﻿using System.ComponentModel.DataAnnotations;

namespace PoliticalClassifier.Web.Models
{
	/// <summary>
	/// Represents a named set of x, y data.
	/// </summary>
	/// <remarks>
	/// This view-model class is used to facilitate the transfer of data between views and controllers.  It represents a named set of x, y data.  Specifically, it is used in the transfer of attribute weight values and party coordinates.
	/// </remarks>
	public class PointViewModel
	{
		/// <summary>
		/// The name associated with the x, y data.
		/// </summary>
		/// <value>
		/// In the case of attribute weight data, this property corresponds to the attribute name.  In the case of party coordinate data, this property corresponds to the party name.
		/// </value>
		[Required]
		public string Name { get; set; }


		/// <summary>
		/// The x component of the data.
		/// </summary>
		/// <value>
		/// This is a required property, which is limited to the range of real numbers between -1.0 and 1.0 inclusive.  In the case of attribute weight data, this property corresponds to the x component of the attribute weight.  In the case of party coordinate data, this property corresponds to the party's x coordinate.
		/// </value>
		[Required]
		[Range(-1, 1)]
		public double? X { get; set; }


		/// <summary>
		/// The y component of the data.
		/// </summary>
		/// <value>
		/// This is a required property, which is limited to the range of real numbers between -1.0 and 1.0 inclusive.  In the case of attribute weight data, this property corresponds to the y component of the attribute weight.  In the case of party coordinate data, this property corresponds to the party's y coordinate.
		/// </value>
		[Required]
		[Range(-1, 1)]
		public double? Y { get; set; }
	}
}